﻿<!DOCTYPE html>
<html lang="zh-cmn-Hans">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
        <meta http-equiv="Access-Control-Allow-Origin" content="*">
		<title>WeUI</title>
		<link rel="stylesheet" href="css/weui.min.css" />
		<link rel="stylesheet" href="css/jquery-weui.css" />
		<link rel="stylesheet" href="css/example.css" />
		<script src="js/jquery-2.1.4.min.js"></script>
		<script type="text/javascript" src="js/jquery-weui.js"></script>
		<script type="text/javascript">
			$(document).ready(function() {
				getlist();

			})
            function heartclick(obj){
                $(".heart").click(function() {
                    
                        dianzan();
                        $(this).addClass('click');
                   

                })
            }
		</script>
		<!--     <script>$(document.body).pullToRefresh();</script> -->
	</head>

	<body ontouchstart>

		<!-- body 顶部加上如下代码 -->
		<div class="weui-pull-to-refresh-layer">
			<div class="pull-to-refresh-arrow"></div>
			<!-- 上下拉动的时候显示的箭头 -->
			<div class="pull-to-refresh-preloader"></div>
			<!-- 正在刷新 -->
			<div class="down">下拉刷新</div>
			<!-- 下拉过程显示的文案 -->
			<div class="up">释放刷新</div>
			<!-- 下拉超过50px显示的文案 -->
			<div class="refresh">正在刷新...</div>
			<!-- 正在刷新时显示的文案 -->
		</div>
		<div class="container" id="container">

			<div class="super-head pr">
				<a class="pa ft16 white" style="left:15px;" href="javascript:history.back();"><img class="fl" style="margin-top:13px;margin-right:3px;" src="images/icon-back.png" width="10" alt=""><span class="fr">返回</span></a>音乐列表
				<a class="pa ft16 white" style="right:15px;" href="upload.html"><img class="fr" style="margin-top:10px;margin-right:3px;" src="images/icon-plus.png" width="25" alt=""><span class="fl"></span></a>
			</div>
			<img src="images/bg-list.jpg" alt="">
			<!--         <div class="weui-form-preview" style="margin-top: -10px;margin-bottom: 80px;">
                <div class="weui-form-preview__hd">
                    <label class="weui-form-preview__label grey2">乐趣印象</label>
                    <em class="weui-form-preview__value">&nbsp;</em>
                </div>
                </div> -->
			<div class="weui-panel weui-panel_access" style="margin-top: -20px;">
				<div class="weui-panel__hd">乐趣印象</div>
				<div id="list" class="weui-panel__bd">

		
				
					

				</div>
			</div>
			<div class="weui-btn-area">
				<a href="upload.html" class="weui-btn weui-btn_primary">我也为它添加印象歌曲</a>
			</div>
		</div>
		<!-- <div class="content-padded" id="page-ptr">
      <p>当前时间: <strong id="time">Sat Oct 29 2016 16:07:31 GMT+0800 (中国标准时间)</strong></p>
    </div> -->

		<script src="js/zepto.min.js"></script>
		<script type="text/javascript" src="js/jweixin-1.0.0.js"></script>
		<script type="text/javascript" src="js/demos.js"></script>
		<script type="text/javascript">
			function dianzan() {
				$.ajax({
					//生产环境url: "http://121.40.48.209:8290/api/v1/mymusiclab/",
					//测试环境
					url: "http://myapi.ishuttle.cn/api/v1/mymusiclab?id=1&zan=1",
					type: "get",
					cache: false,

					dataType: 'json',
					success: function(res) {},
					error: function(res) {

					}
				})
			}
		</script>
		<script type="text/javascript">

			// function getlist() {
			// 	var faceid = $('#Face_ID').val();
			// 	$.ajax({
			// 		url: "http://myapi.ishuttle.cn/api/v1/mymusiclab/",
					
			// 		type: "POST",
			// 		cache: false,
			// 		data: {
			// 			Face_ID: faceid
			// 		},
			// 		dataType: 'json',
			// 		success: function(res) {





			// 			console.log(res);
			// 		},
			// 		error: function(res) {
			// 			console.log(res);
			// 		}
			// 	})


			// }




		</script>



<script type="text/javascript">
            function getlist() {
                var faceid = '420e7dfc1c086856b3aab23da54cee4c';
                $.ajax({
                    url: "http://121.40.48.209:8290/api/v1/mymusiclab/",
                    
                    type: "POST",
                    cache: false,
                    data: {
                        Face_ID: faceid
                    },
                    dataType: 'json',
                    success: function(res) {

                       for(var i=0;i<res.length;i++){
                        sfa(res[i]._MusicUrl,res[i]._zannum,res[i]._AddTime,res[i]._MyMusicLab_ID,res[i]._face_id,res[i]._singer);
                        console.log(res);
                    }
                    },
                    error: function(res) {
                        console.log(res);
                    }
                })
            }
        </script>

        <script>
            function sfa(url,zannum,AddTime,_MyMusicLab_ID,_face_id,_singer) {
                 var htmll = "";

                 htmll +='<div class="weui-media-box weui-media-box_appmsg"><div class="weui-media-box__hd"><a href='+url+'><img class="weui-media-box__thumb" src="images/thumb.png" alt=""></a></div><div class="weui-media-box__bd"><h4 class="weui-media-box__title">'+_singer+'</h4><div class="weui-media-box__desc pr"><div class=""><br><span class="blue">'+zannum+'</span>人觉得它适合这首歌</div><div class="pa" style="right:0;top: 0;"><div id='+_face_id+' class="heart" onclick="heartclick();"></div></div><div style="clear: both;"></div></div></div></div>';
       
            document.getElementById("list").innerHTML += htmll;
            }
           


        </script>
		<input type="hidden" name="Face_ID" id="Face_ID" value="420e7dfc1c086856b3aab23da54cee4c">
	</body>

</html>